package indi.woniu.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import indi.woniu.entity.ResponseEntity;
import indi.woniu.entity.StudentAnswer;
import indi.woniu.service.StudentAnswerService;
import indi.woniu.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/studentAnswerController")
public class StudentAnswerController {
    @Autowired
    private StudentAnswerService studentAnswerService;
    @RequestMapping("/saveAnswer")
    public ResponseEntity saveAnswer(@RequestBody StudentAnswer studentAnswer){
        int i = studentAnswerService.saveAnswer(studentAnswer);
        if(i>0){
            return new ResponseEntity(200,"保存成功",null);
        }else {
            return new ResponseEntity(200,"保存失败",null);
        }

    }

}
